﻿using System.Web;
using System.Web.SessionState;

namespace MY.ShoppingBackstage.Models
{
    /// <summary>
    /// 当前管理员信息上下文类
    /// </summary>
    public class AdminUserContext
    {
        /// <summary>
        /// 会话的key
        /// </summary>
        private const string sessionKey = "USERINFO_SESSION_KEY";
        /// <summary>
        /// 
        /// </summary>
        public HttpSessionState httpSession => HttpContext.Current.Session;

        /// <summary>
        /// 
        /// </summary>
        public static AdminUserContext current = new AdminUserContext();

        /// <summary>
        /// 用户信息上下文
        /// </summary>
        //public AdminUser userInfo
        //{
        //    get
        //    {
        //        return this.httpSession[sessionKey] as AdminUser;

        //    }
        //    set
        //    {
        //        this.httpSession[sessionKey] = value;
        //    }
        //}
    }
}